import request from '@/utils/request'

// 查询参保方案列表
export function listCbfa(query) {
  return request({
    url: '/cbfa/cbfa/list',
    method: 'get',
    params: query
  })
}

// 查询参保方案详细
export function getCbfa(id) {
  return request({
    url: '/cbfa/cbfa/' + id,
    method: 'get'
  })
}

// 新增参保方案
export function addCbfa(data) {
  return request({
    url: '/cbfa/cbfa',
    method: 'post',
    data: data
  })
}

// 修改参保方案
export function updateCbfa(data) {
  return request({
    url: '/cbfa/cbfa',
    method: 'put',
    data: data
  })
}

// 删除参保方案
export function delCbfa(id) {
  return request({
    url: '/cbfa/cbfa/' + id,
    method: 'delete'
  })
}

export function getAdjustList(categoryId) {
  return request({
    url: '/detail/detail/listByCategory/' + categoryId,
    method: 'get'
  })
}

export function delHousingItem(ids) {
  // 将数组转换为以逗号分隔的字符串
  const idStr = ids.join(','); 
  return request({
    url: `/detail/detail/${idStr}`,
    method: 'delete'
  })
}

export function updateInsurancePlanDetail(data) {
  return request({
    url: '/detail/detail',
    method: 'put',
    data: data
  })
}
